<template>
  <div class="box">
    <div class="header">
      <span class="iconfont iconfeiji"></span>
      <span>国内机票</span>
    </div>
    <div class="big">
      <div class="one">

        <AirSearchForm />

      </div>
      <img class="advertising" src="http://157.122.54.189:9093/images/pic_sale.jpeg" />
    </div>
    <div class="data">
      <div class="two">😡100%航协认证</div>
      <div class="two">😡出行保证</div>
      <div class="two">😡7×24小时服务</div>
    </div>
    <div class="text"><i class="iconfont icontejiajipiao"></i>特价机票</div>
    <div class="recommend">
      <div class="three" v-for="(item,index) in recommend" :key="index" > 
        <img src="https://imgsrc.baidu.com/baike/pic/item/a71ea8d3fd1f41340d8f3dec281f95cad0c85ee3.jpg" alt="图片"> 
        <div class="four"><span>{{item.departCity}} - {{item.destCity}}</span> <span>{{item.price}}</span> </div>
      </div>  
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return {
      recommend:[],
    }
  },
  async mounted(){
    let list = await this.$axios.get('/airs/sale')
    console.log(list);
    this.recommend = list.data.data
  }
};
</script>

<style lang="less" scoped>
.box {
  width: 1000px;
  margin: 0 auto;
  box-sizing: border-box;
  span {
    line-height: 60px;
    font-size: 26px;
    color: #ffa500;
  }
}
.big {
  display: flex;
  width: 103%;
  justify-content: space-between;
  img {
    width: 640px;
    height: 350px;
  }
  .one {
    width: 340px;
    height: 350px;
    border: 1px solid #ced4ca;
  }
}
.data{ 
  margin: 20px auto 5px;
  width: 103%;
  background: #f5f3f3;
  display: flex;
  padding: 14px;
  .two{
    flex: 1;
    text-align: center;
    &:nth-child(2){
      border-left: 2px solid #acaaaa;
      border-right: 2px solid #acaaaa;
    }
  } 
}
.text {
  font-size: 20px;
  color: #409eff;
  line-height: 48px;
}
.recommend {
  width: 103%;
  padding: 14px 0 6px;
  margin-bottom: 20px;
  border: solid #dddddd 1px;
  display: flex;
  justify-content: space-evenly;
  //space-eveny: 均匀分配空间
  img {
    width: 246px;
    height: 156px;
  }
  .three {
    position: relative;
    width: 246px;
    height: 156px;
    .four {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      background: #0000005c;
      z-index: 100;
      display: flex;
      justify-content: space-between;
      padding: 2px 6px;
      box-sizing: border-box;
      span {
        font-size: 12px;
        line-height: 16px;
        color: #f5f3f3;
      }
    }
  }
}
</style>